import request from '@/utils/request'

// 分类：获取文章分类列表
export const articleGetChannelListService = () => request.get('/my/cate/list')
// 分类：增加文章分类
// post body:{cate_name,cate_alias}
export const articleAddChannelService = (data) =>
  request.post('/my/cate/add', data)
// 分类：修改文章分类
// put body:{id,cate_name,cate_alias}
export const articleEditChannelService = (data) =>
  request.put('/my/cate/info', data)
// 分类：删除文章分类
// delete query:{id}
export const articleDeleteChannelService = (id) =>
  request.delete('/my/cate/del/?id=' + id)

// 文章：获取文章列表
// get query:{pagenum,pagesize,cate_id,state}
export const articleGetArticleListService = (params) =>
  request.get('/my/article/list', { params })
// 文章：获取文章详情
// get query:{id}
export const articleGetArticleDetailService = (id) =>
  request.get('/my/article/info', { params: { id } }) // 或者这样也行?id=' + id
// 文章：增加文章  这里要传form-data格式的数据
// post body form-data格式的数据
export const articleAddArticleService = (data) =>
  request.post('/my/article/add', data)
//文章：更新文章  这里要传form-data格式的数据
// put body form-data格式的数据
export const articleEditArticleService = (data) =>
  request.put('/my/article/info', data)
// 文章：删除文章
// delete query:{id}
export const articleDeleteArticleService = (id) =>
  request.delete('/my/article/info', { params: { id } })
